﻿namespace ufida.u9.ait.openapi
{
	using System;
	using System.Collections.Generic;
	using System.Text;
    using ufida.u9.ait.openapi.utils;
    using UFIDA.U9.ER.Enums;
    using UFIDA.U9.ER.ReimburseBill;
    using UFSoft.UBF.AopFrame;	
	using UFSoft.UBF.Util.Context;

	/// <summary>
	/// ReimburseBillApproveSV partial 
	/// </summary>	
	public partial class ReimburseBillApproveSV 
	{	
		internal BaseStrategy Select()
		{
			return new ReimburseBillApproveSVImpementStrategy();	
		}		
	}
	
	#region  implement strategy	
	/// <summary>
	/// Impement Implement
	/// 
	/// </summary>	
	internal partial class ReimburseBillApproveSVImpementStrategy : BaseStrategy
	{
		public ReimburseBillApproveSVImpementStrategy() { }

		public override object Do(object obj)
		{						
			ReimburseBillApproveSV bpObj = (ReimburseBillApproveSV)obj;

			return CodeUtils.DocUpdateNT<DocDTOData, ReimburseBillHead>(bpObj, bpObj.Data,
				(doc) =>
				{
					if(doc.DocStatus== ReimburseDocStatusEnum.Opened)
					{
                        ReimburseBillBase.SubmitDoc(doc);
                    }
					ReimburseBillBase.ApproveDoc(doc);
					return doc;
				});
		}		
	}

	#endregion
	
	
}